Skip to content

feat(bigquery): add BigLake configuration support for Storage Write API - #36225

Merged
liferoad merged 15 commits into
apache:masterfrom
liferoad:biglake-table-create
Sep 29, 2025
Merged

feat(bigquery): add BigLake configuration support for Storage Write API#36225
liferoad merged 15 commits into
apache:masterfrom
liferoad:biglake-table-create

Conversation

@liferoad

@liferoad liferoad commented Sep 21, 2025

Copy link
Copy Markdown
Contributor

add BigLake configuration parameter to StorageWriteToBigQuery transform in both Java and Python SDKs include validation tests for BigLake configuration parameters

Fixes #36171

Postcommit:

./gradlew :sdks:python:test-suites:dataflow:py312:gcpCrossLanguagePythonUsingJava 

Run biglake:

./gradlew :sdks:java:io:google-cloud-platform:expansion-service:build
export EXPANSION_JARS=":sdks:java:io:google-cloud-platform:expansion-service" && pytest sdks/python/apache_beam/io/external/xlang_bigqueryio_it_test.py::BigQueryXlangStorageWriteIT::test_write_with_big_lake_configuration -v -s --tb=long --log-cli-level=INFO --test-pipeline-options="--runner=DataflowRunner --project=apache-beam-testing --region=us-central1 --temp_location=gs://temp-storage-for-end-to-end-tests/temp-it --staging_location=gs://temp-storage-for-end-to-end-tests/staging-it --sdk_location=sdks/python/dist/apache_beam-2.69.0.dev0.tar.gz --sdk_harness_container_image_overrides=.*java.*,gcr.io/apache-beam-testing/beam-sdk/beam_java17_sdk:latest"

Results:

INFO     apache_beam.runners.dataflow.dataflow_runner:dataflow_runner.py:157 Job 2025-09-27_20_25_41-8093218567865133121 is in state JOB_STATE_DONE
INFO     apache_beam.io.gcp.tests.bigquery_matcher:bigquery_matcher.py:121 Attempting to perform query SELECT * FROM python_xlang_storage_write_1759029922_fb423e.write_with_big_lake_config to BQ
INFO     apache_beam.io.gcp.tests.bigquery_matcher:bigquery_matcher.py:158 Result of query is: [(1, 0.1, Decimal('1.11'), 'a', True, b'a', datetime.datetime(1970, 1, 1, 0, 16, 40, 100, tzinfo=datetime.timezone.utc)), (3, 0.3, Decimal('3.33'), 'c', True, b'd', datetime.datetime(1970, 1, 1, 0, 50, 0, 300, tzinfo=datetime.timezone.utc)), (4, 0.4, Decimal('4.44'), 'd', False, b'd', datetime.datetime(1970, 1, 1, 1, 6, 40, 400, tzinfo=datetime.timezone.utc)), (2, 0.2, Decimal('2.22'), 'b', False, b'b', datetime.datetime(1970, 1, 1, 0, 33, 20, 200, tzinfo=datetime.timezone.utc))]
INFO     apache_beam.io.gcp.gcsio:gcsio.py:629 Finished listing 2 files in 0.41817498207092285 seconds.
INFO     apache_beam.io.external.xlang_bigqueryio_it_test:xlang_bigqueryio_it_test.py:197 Successfully verified 2 objects created in warehouse location gs://apache-beam-testing-bq-biglake/BigQueryXlangStorageWriteIT/apache-beam-testing/python_xlang_storage_write_1759029922_fb423e/write_with_big_lake_config
INFO     apache_beam.io.external.xlang_bigqueryio_it_test:xlang_bigqueryio_it_test.py:126 Deleting dataset python_xlang_storage_write_1759029922_fb423e in project apache-beam-testing
PASSED

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

add BigLake configuration parameter to StorageWriteToBigQuery transform in both Java and Python SDKs
include validation tests for BigLake configuration parameters
@github-actions github-actions Bot added the build label Sep 22, 2025
testJavaHome = project.findProperty("java${testJavaVersion}Home")
}

// Detect macOS and append '-macos' to tox environment to avoid pip check issues

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need changes to this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this to run the tests locally on mac

Comment thread sdks/python/apache_beam/io/gcp/bigquery_biglake_test.py
@liferoad
liferoad marked this pull request as ready for review September 24, 2025 02:04
@liferoad
liferoad requested a review from ahmedabu98 September 24, 2025 02:05
@github-actions

Copy link
Copy Markdown
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

Comment thread sdks/python/apache_beam/io/external/xlang_bigqueryio_it_test.py
@codecov

codecov Bot commented Sep 27, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.17%. Comparing base (bbf3613) to head (9bc57ae).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...igQueryStorageWriteApiSchemaTransformProvider.java 0.00% 1 Missing and 1 partial ⚠️
sdks/python/apache_beam/io/gcp/bigquery.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #36225       +/-   ##
=============================================
- Coverage     56.84%   40.17%   -16.68%     
+ Complexity     3386     3384        -2     
=============================================
  Files          1220     1220               
  Lines        185898   185902        +4     
  Branches       3523     3524        +1     
=============================================
- Hits         105672    74680    -30992     
- Misses        76885   107878    +30993     
- Partials       3341     3344        +3     
Flag Coverage Δ
java 70.37% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@liferoad
liferoad requested a review from ahmedabu98 September 28, 2025 12:10
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @shunping for label python.
R: @m-trieu for label java.
R: @Abacn for label build.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@ahmedabu98 ahmedabu98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liferoad
liferoad merged commit 50e14ac into apache:master Sep 29, 2025
126 of 130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: [Python] Support creating BigLake Iceberg tables in BigQuery

2 participants